package com.tokenplus.thai.aviewmodel

import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.Transformations
import com.tokenplus.thai.base.BaseViewModel
import com.tokenplus.thai.anetwork.ApiUserReposity
import com.tokenplus.thai.data.ReqBase

class NewComerEnjoyViewModel : BaseViewModel() {

    //////////////////////////////////////////
    private val mGetNewComerEnjoyLiveData = MutableLiveData<ReqBase>()

    val onGetNewComerEnjoyLiveData =
        Transformations.switchMap(mGetNewComerEnjoyLiveData) { query ->
            ApiUserReposity.getNewComerEnjoy(this, query)
        }

    fun getNewComerEnjoy(reqBase: ReqBase) {
        mGetNewComerEnjoyLiveData.value = reqBase
    }
}